package com.morontestandroid;

import android.app.Activity;
import android.app.Dialog;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.Chronometer;
import android.widget.ImageView;

public class FailActivity extends Activity implements android.view.View.OnClickListener{
	ImageView tryAgain;
	ImageView exitImage;
	ImageView checkImage;
	
	public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.fail_layout);
       
        tryAgain = (ImageView) findViewById(R.id.tryAgainId);
        exitImage = (ImageView) findViewById(R.id.exitImageId);
        checkImage = (ImageView) findViewById(R.id.gotocheck);
       
        tryAgain.setOnClickListener(this);
        exitImage.setOnClickListener(this);
        checkImage.setOnClickListener(this);
        
        if(!check())checkImage.setVisibility(View.GONE);
       
       
	}
	
	public boolean check() {
		  Bundle extras = getIntent().getExtras();
		  boolean check = extras.getBoolean("check");
		  return check;
		 
	}
	
public void onClick(View view) {
		
		
		
		Dialog d = new Dialog(this);
		if(view.getId()==R.id.tryAgainId) {
			startActivity(new Intent(this, FirstLevel.class));
		}
		
		else if(view.getId()==R.id.exitImageId) {
			startActivity(new Intent(this, MenyActivity.class));
		}
		
}
}
